<%@page import="com.shop2.entity.Admin"%>
<%@page import="com.shop2.service.java.AdminServiceImpl"%>
<%@page import="com.shop2.service.AdminService"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>

<%
String uid = request.getParameter("username");
String pwd = request.getParameter("password");
String rname = request.getParameter("realname"); 
rname = new String(rname.getBytes("iso-8859-1"),"utf-8");
AdminService admin1 =new AdminServiceImpl();
Admin admin = new Admin();
admin.setUsername(uid);
admin.setPassword(pwd);
admin.setRealname(rname);
int result = admin1.registet(admin);

if(result==1)
{
	out.print("ok");
	out.print("<br>");
	out.print(uid);
	out.print("<br>");
	out.print(pwd);
	out.print("<br>");
	out.print(rname);
	out.print("<br>");
}
else if (result==-1)
{
	out.print("username is esited");
}
else
{
	out.print("not ok");
}

%>
</body>
</html>